/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.dao;


import java.util.List;
import model.pojo.*;
import model.util.HibernateUtil;
import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;


/**
 *
 * @author CUCAINHO
 */
public class DiaDiemDAO {
public static List<Diadiem> LayDanhSachDiem() { 
            
    List<Diadiem> danhSachDiaDiem = null;
    
    Session session = HibernateUtil.getSessionFactory().openSession();
    try {
            String hql = "select dd from Diadiem dd"; 
            Query query = session.createQuery(hql);
            //Query query = session.createQuery(hql);             
            danhSachDiaDiem = query.list(); 
        }catch (HibernateException ex) 
        { //Log the exception 
            System.err.println(ex); 
        } 
        finally {
            session.close(); 
        } 
    return danhSachDiaDiem; 
    }
}

